package com.syni.mdd.sjb.common.datatreaure.handler.news;

import com.alibaba.fastjson.JSON;
import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.DxshAppNews;
import com.syni.mdd.sjb.common.datatreaure.constants.Constants;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rp.dataBankBusiness.NewDetailParamsRpVo;
import lombok.Data;

import java.util.Map;

@Data
public class MarketingRealityHandler extends NewsHandler {
    public void handle(DxshAppNews dxshAppNews, NewDetailParamsRpVo newDetailParamsRpVo){
        if(dxshAppNews.getMessageSecondType() == Constants.DXSH_APP_NEW_MARKET_REALITY_TYPE){
            newDetailParamsRpVo.setGlobalMessageType(NewDetailParamsRpVo.MARKETING_REALITY);
            Map<String,Object> dataMap = JSON.parseObject(dxshAppNews.getContent());
            if(dataMap.containsKey("jumpUrl")){
                newDetailParamsRpVo.setJumpUrl(dataMap.get("jumpUrl").toString());
            }
        }
    }
}
